home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Apr 90 / MacApp.Tech$ 4⁄20⁄90 / 1140-Bug non-unique fIden-Apr90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.1 KB  |  45 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    7579347                         19-April-90        03:28PDT
  4.  
  5. From:   D4727                           Ghent Farm, Jesse Feiler,AST
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    Bug: non-unique fIdentifier
  10.  
  11. I don't know if this is a known bug or not…
  12.  
  13. In MacApp 2.0ß9, TDialogView.DoOpen relies on the target's fIdentifier field
  14. being unique.  In fact, views created programmatically (rather than from
  15. ViewEdit resources) are very likely to have non-unique fIdentifiers--since
  16. TView.IView sets fIdentifier to kNoIdentifier ('   ').  ViewEdit nicely numbers
  17. the views (VW01, VW02), so unless you deliberately change one of those unique
  18. identifiers, you're ok using views created from resources.
  19.  
  20. What happens is that if you happen to have a non-unique view fIdentifier (like
  21. '    ') on a TDialogView's target which is a TEditText, the TEditText view is
  22. not selected on opening the window (since the FindSubView code may not pick up
  23. the correct subview), fTEView is left to be NIL, but the TDialogView's fTarget
  24. remains set to the TEditText view.  THEN, when you try to click on the field,
  25. TEditText.DoMouseCommand blows up, since it assumes that if it is the target,
  26. fTEView is non-NIL.
  27.  
  28. There are various possible solutions, including having TDialogView.DoOpen do
  29. some preventive checking (in debug mode only), or modifying
  30. TEditText.DoMouseCommand so that it correctly handles the fTEView = NIL case.
  31. (TEditText.DoKeyCommand handles this correctly, so that while you can't select
  32. the field with the mouse, entering it with the tab key works properly.)
  33.  
  34. Either way, this is one of those nasties that manifests itself far away from
  35. the original source of the error.  In addition, it may come and go during
  36. development because TDialogView.DoOpen will function correctly if the target
  37. TEditText view has a non-unique fIdentifier BUT is the first so-identified view
  38. in the subview list.  (Not a rare occurrence -- we often set the target to the
  39. first field in the window, and we often create those views in order). So I pass
  40. on this saga in case it saves anyone else some time and/or grief.
  41.  
  42. JF
  43.  
  44.  
  45.